package com.mszlu.news.admin.controller;

import com.mszlu.news.admin.model.params.ComplainParam;
import com.mszlu.news.admin.service.ComplainService;
import com.mszlu.news.admin.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "举报接口")
@RestController
@RequestMapping("complain")
public class ComplainController {

    @Autowired
    private ComplainService complainService;

    @ApiOperation(value = "增加举报")
    @PostMapping("add")
    public Result addComplain(@RequestBody ComplainParam complainParam){
        return complainService.addComplain(complainParam);
    }

    @ApiOperation(value = "搜索举报")
    @PostMapping("select")
    public Result selectComplain(@RequestBody ComplainParam complainParam){
        return complainService.selectComplain(complainParam);
    }

    @ApiOperation(value = "删除举报")
    @PostMapping("delete/{id}")
    public Result deleteComplain(@PathVariable("id") Long id){
        return complainService.deleteComplain(id);
    }
}
